	<style>
dt{
    color: #333333;
    float: left;
    margin: 0;
    padding: 4px 0 0;
    text-align: right;
	width:80px;
	font-weight:600;
	font-size:14px;
}
dd{
	 margin-left: 10px;
      padding: 4px 0 4px 5px;
	line-height:25px;
	overflow:hidden;
}	
dl{clear:both;line-height:25px;}
a{color:blue;font-size:14px;}
#cate_more{float:right;cursor:pointer;}
.select-bar{padding:15px;border:1px solid gray;margin-top:15px;}
#center-column .selected{width:97%;height:120px;background:none repeat scroll 0 0 #BBD9EE;padding:15px;border:1px solid gray;}
#center-column .selected ul{float:left;width:800px;padding:0px;}
#center-column .selected li{list-style-type:none; width:240px;font-size:18px;float:left;height:20px;line-height:20px;padding:5px;margin-left:10px;margin-top:10px;}
#center-column .selected li span{color:green;}
.search_mod{width:auto;}
.color{border:1px solid blue;}
.or{overflow:hidden;height:30px;}
.trs,.selected img,#clear_all,.update_version{cursor:pointer;}
.version{display:none;}
.simplemodal-data{ width:980px;  height:auto; overflow-y:auto; overflow-x:hidden; background:#fff; border:6px #2b2b2b solid; padding:16px;}
.bs{ background-color:#BBD9EE;}
</style>


<script language="javascript">

  $(document).ready(function(){
	  $('.date-pick').datePicker({startDate:'1996.01.01'});
      $("#cate_more").click(function(){
          var cate = $("#cate").val();
          if(cate==0){
             $(this).parents("dl").removeClass("or");
             $("#cate").val("1");
          }else{
        	 $(this).parents("dl").addClass("or");
        	 $("#cate").val("0");
          }
      })
      $(".category a").each(function(){
             $(this).click(function(){
            	 var category_id = $(this).attr("alt");
                 var category = $(this).html();
                 $("#category_span").html();
                 $("#category_span").html(category);
                 $("#category").val(category_id);
                 $.ajax({
    		    	   type: "POST",
    		    	   url: "<?php echo base_url();?>main/getversion",
    		    	   data: "category_id="+category_id,
    		    	   success: function(msg){
                            $(".version dd").html(msg);  
                            $(".version").show(); 
    		    	   } 
    		    	});
             })        
      })
      
     $(".mod a").each(function(){
             $(this).click(function(){
                 var mod_id = $(this).attr("alt");
                 var mod = $(this).html();
                 $("#mod_span").html();
                 $("#mod_span").html(mod);
                 $("#mod").val(mod_id);
                 $.ajax({
    		    	   type: "POST",
    		    	   url: "<?php echo base_url();?>main/getcategory",
    		    	   data: "mod_id="+mod_id,
    		    	   success: function(msg){
                            $("#category_detail").html(msg);  
    		    	   } 
    		    	});
             })        
      })
      $(".company a").each(function(){
             $(this).click(function(){
                 var company_id = $(this).attr("alt");
                 var company = $(this).html();
                 $("#company_span").html();
                 $("#company_span").html(company);
                 $("#company").val(company_id);
             })        
      })
      $(".level a").each(function(){
             $(this).click(function(){
                 var level_id = $(this).attr("alt");
                 var level = $(this).html();
                 $("#level_span").html();
                 $("#level_span").html(level);
                 $("#level").val(level_id);
             })        
      })
      $(".update a").each(function(){
             $(this).click(function(){
                 var update_id = $(this).attr("alt");
                 var update = $(this).html();
                 $("#update_span").html();
                 $("#update_span").html(update);
                 $("#update").val(update_id);
             })        
      })
   
      $(".selected img").each(function(){
             $(this).click(function(){
                 var at=$(this).attr("class");
                
                 var sp="#"+at+"_span";
                 var ids = "#"+at;
                 if(at=="version2"){
                     var  sp="#version_span";
                     var  ids = "#version";
                 }
                 $(sp).html("全部");
                 $(ids).val('');
             })
      })      
      $("#clear_all").click(function(){
          $("#mod_span").html("全部");
          $("#category_span").html("全部");
          $("#level_span").html("全部");
          $("#update_span").html("全部");
          $("#company_span").html("全部");
          $("#version_span").html("全部");
          $("#mod").val("");
          $("#version").val("");
          $("#category").val("");
          $("#update").val("");
          $("#level").val("");
          $("#company").val("");
          $("#index_form").submit();
      })
      $(".trs").click(function(){
          var category_id = $(this).attr("id");
          var role = $("#role").val();
          $.ajax({
        	   type: "POST",
        	   url:"<?php echo  base_url();?>main/get_category_detail",
        	   data: "category_id="+category_id,
               dataType:'json', 
        	   success: function(msg){       
            	  var str = '<script language="javascript" src="<?php echo base_url();?>js/jquery.js"><\/script><script language="javascript" src="<?php echo base_url();?>js/jquery.modal.js"><\/script><table class="listing form" cellpadding="0" cellspacing="0" style="width:950px;">';
                      str+='<tr><th class="first" width="100">型号</th><th>资料名称</th><th>资料版次</th><th>总份数</th><th>密级</th><th>接收日期</th><th>初始版次</th><th>当前版次</th><th>有效版次</th><th>发往单位</th><th>发出时间</th><th>更改时间</th><th>更改标记</th><th class="last">附注</th><th></th></tr>';
        	      for(var i=0;i<msg.length;i++){
                       str+='<tr><td><input type="hidden" value="'+msg[i].id+'" /><input type="hidden" value="'+msg[i].company+'" />'+msg[i].mod+'</td><td>'+msg[i].category+'</td><td>'+msg[i].version+'</td><td>'+msg[i].total_count+'</td><td>'+msg[i].level+'</td><td>'+msg[i].receive_date+'</td><td>'+msg[i].orignal_version+'</td><td>'+msg[i].current_version+'</td><td>'+msg[i].valid_version+'</td><td>'+msg[i].company+'</td><td>'+msg[i].sendtime+'</td><td>'+msg[i].updatetime+'</td><td>'+msg[i].updatedes+'</td><td>'+msg[i].updatedes+'</td><td>';
                      if(msg[i].current_version==msg[i].valid_version){
                    	      str+='</td></tr>';
                          }else{
                              if(role==0){
                        	    str+='<span class="update_version" onclick="update_version(this)">更新版次</span></td></tr>';
                              }else{
                            	  str+='</td></tr>';
                              }
                          }                      
                	  }
          	          str+='</table>'; 
            	 $("#version_detail").html('');
          	     $("#version_detail").append(str);      	  
    	         $("#version_detail").modal();
        	   }
        	});
      })

    $("#simplemodal-container a").click(function(){
 alert('xx');
        })
         
    })
  
  function version_click(v){
	  var version_id = $(v).attr("alt");
      var version = $(v).html();
      $("#version_span").html();
      $("#version_span").html(version);
      $("#version").val(version_id);
  }    


  function category_click(v){
	  var category_id = $(v).attr("alt");
      var category = $(v).html();
      $("#category_span").html();
      $("#category_span").html(category);
      $("#category").val(category_id);

      $.ajax({
	    	   type: "POST",
	    	   url: "<?php echo base_url();?>main/getversion",
	    	   data: "category_id="+category_id,
	    	   success: function(msg){
                 $(".version dd").html(msg);  
                 $(".version").show(); 
	    	   } 
	    	});
   }

  
  function update_receive_data(){
	  	var receive_id = $("#receive_id").val();
	    var mod_id = $("#mod_id").val();
	    var category_id = $("#category_id").val();
	    var count = $("#count").val();
	    var codes = $("#codes").val();
	    var version_id = $("#version_id").val();
	    var pre_version = $("#pre_version").val();
	    var pre_count = $("#pre_count").val();
	    var pre_count_record = $("#pre_count_record").val();
	    var pre_codes = $("#pre_codes").val();

	    var v = $("#version_id").find("option:selected").text();
	      var preversion = $("#current_id_notice").html();
	      var v=v.replace(".","");
	      var v=v.replace(".","");
	      var preversion=preversion.replace(".","");            
	      var preversion=preversion.replace(".","");
	      if(parseInt(v)<=parseInt(preversion)){
	    	  alert('更新至版次必须高于当前版次');
	    	  return false;
	      }  
	    if(version_id==""){
           alert("接收版次不能空!");
           return false;
		}
	    if(codes==""){
           alert('接收单号不能空!');
           return false;
	    }
	    if(count==""){
           alert("接收份数不能空!");
           return false;
		}
	    var str = "pre_count_record="+pre_count_record+"&pre_codes="+pre_codes+"&codes="+codes+"&mod_id="+mod_id+"&category_id="+category_id+"&version_id="+version_id+"&pre_version="+pre_version+"&pre_count="+pre_count+"&count="+count+"&receive_id="+receive_id;
	    $.ajax({
	    	   type: "POST",
	    	   url:"<?php echo  base_url();?>model/update_receive",
	    	   data: str, 
	    	   success: function(msg){          	  
	                
	                if(msg=='1'){
	                  alert("操作成功!");
	                  $(".simplemodal-close").click();
	                  window.location.reload();
	                }else{
                      alert(msg);
		            }
	                
	    	   }
	    	});

  }


  function update_send_data(){
	  var send_id = $("#send_id").val();
      var mod_id = $("#mod_id").val();
      var category_id = $("#category_id").val();
      var des = $("#des").val();
      var codes = $("#codes").val();
      var count = $("#count").val();
      var version_id = $("#version_id").val();
      var pre_version = $("#pre_version").val();
      var pre_count = $("#pre_count").val();
      var pre_codes = $("#pre_codes").val();
      var company_id = $("#company_id").val();
      
      var v = $("#version_id").find("option:selected").text();
      var preversion = $("#current_id_notice").html();
      var v=v.replace(".","");
      var v=v.replace(".","");
      var preversion=preversion.replace(".","");            
      var preversion=preversion.replace(".","");
      
      if(parseInt(v)<=parseInt(preversion)){
    	  alert('更新至版次必须高于当前版次');
    	  return false;
      }
      if(codes==""){
          alert("发放单据号不能空!");
          return false;
      }
      if(count==""){
          alert("资料份数不能空!");
          return false;
      }
     
      var str = "pre_codes="+pre_codes+"&codes="+codes+"&company_id="+company_id+"&mod_id="+mod_id+"&category_id="+category_id+"&des="+des+"&version_id="+version_id+"&pre_version="+pre_version+"&pre_count="+pre_count+"&count="+count+"&send_id="+send_id;
      $.ajax({
      	   type: "POST",
      	   url:"<?php echo  base_url();?>model/update_send",
      	   data: str, 
      	   success: function(msg){          	  
                  
                  if(msg=='1'){
                    alert("操作成功!");
                    $(".simplemodal-close").click();
                    window.location.reload();
                  }else{
                     alert(msg);
                    }
      	   }
      	});
  }
    function check_version(v){
        var v = $(v).find("option:selected").text();
        var pre_version = $("#current_id_notice").html();
        var v=v.replace(".","");
        var v=v.replace(".","");
        var pre_version=pre_version.replace(".","");            
        var pre_version=pre_version.replace(".","");

        if(parseInt(v)<=parseInt(pre_version)){
            alert('更新至版次必须高于当前版次');
        }
    }

  
	function send_update(send_id){
        $.ajax({
        	   type: "POST",
        	   url:"<?php echo  base_url();?>model/get_send_for_layout",
        	   data: "send_id="+send_id,
               dataType:'json', 
        	   success: function(msg){   
      var st = '<table class="listing form" cellpadding="0" cellspacing="0" style="width:550px;margin-left:185px;"><input type="hidden" id="pre_count" /><input type="hidden" id="pre_version" /><input type="hidden" id="mod_id" /><input type="hidden" id="send_id" /><input type="hidden" id="category_id" /><input type="hidden" id="company_id" /><input type="hidden" id="pre_codes" />';
		  st+='<tr><th  colspan="2"  align="center">更新发放版次</th></tr>';
		  st+='<tr><td style="width:100px;text-align:right;"><strong>型号：</strong></td><td style="text-align:left;"><span id="mod_id_notice"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FF0000">版次更新状态下，型号，资料种类不可以更改</font></td></tr>';
		  st+='<tr><td style="width:100px;text-align:right;"><strong>资料种类：</strong></td><td style="text-align:left;"><span id="category_id_notice"></span></td></tr>';
		  st+='<tr><td style="width:100px;text-align:right;"><strong>资料当前版本：</strong></td><td style="text-align:left;"><span id="current_id_notice">'+msg.current_version+'</span></td></tr>';
		  st+='<tr><td style="width:100px;text-align:right;"><strong>更新至版本：</strong></td><td style="text-align:left;"><select name="version_id" id="version_id" onchange="check_version(this)"></select><span id="version_id_notice">&nbsp;&nbsp;<font color="#FF0000">更新至版次必须高于当前版次</font></span></td></tr>';
		  st+='<tr class="bg"><td style="width:100px;text-align:right;"><strong>更新单据号：</strong></td><td style="text-align:left;"><input type="text" class="text" name="codes" id="codes" value="" /></td></tr>';
		  st+='<tr class="bg"><td style="width:100px;text-align:right;"><strong>更新份数：</strong></td><td style="text-align:left;"><input type="text" class="text" name="count" onKeyUp=this.value=this.value.match(/^[0-9]*[1-9][0-9]*$/)==null?"":this.value.match(/^[0-9]*[1-9][0-9]*$/) onafterpaste=this.value=this.value.match(/^[0-9]*[1-9][0-9]*$/)==null?"":this.value.match(/^[0-9]*[1-9][0-9]*$/) id="count" value="" /><span id="count_notice"></span></td></tr>';
		  st+='<tr class="bg"><td style="width:100px;text-align:right;"><strong>备注：</strong></td><td style="text-align:left;"><textarea name="des" cols="50" rows="5" id="des"></textarea></td></tr>';
		  st+='<tr><td colspan="2"><input type="button" value="提交" class="button" onclick="update_send_data()" id="submit"/><input type="button" value="返回" class="button" onclick="return_receive('+msg.category_id+')"/></td></tr></table>';   
		  $("#version_detail").html('');	   
		  $("#version_detail").html(st);   	          	  
          	   $("#mod_id_notice").html(msg.mod);
          	   $("#category_id_notice").html(msg.category);
          	   $("#version_id").html(msg.version);
          	   $("#count").val(msg.count);
          	   $("#mod_id").val(msg.mod_id);
          	   $("#send_id").val(msg.send_id);
          	   $("#category_id").val(msg.category_id);
          	   $("#company_id").val(msg.company_id);
          	   $("#pre_count").val(msg.count);
          	   $("#pre_version").val(msg.pre_verison);
          	   $("#des").val(msg.des);
          	   $("#pre_codes").val(msg.codes);  	       
        	   }
        	});
		
	}

function receive_update(receive_id){
      $.ajax({
    	   type: "POST",
    	   url:"<?php echo  base_url();?>model/get_receive_for_layout",
    	   data: "inventory_id="+receive_id,
           dataType:'json', 
    	   success: function(msg){          	  

  var sss = '<table class="listing form" cellpadding="0" cellspacing="0" style="width:600px;margin-left:170px;">';
      sss+='<input type="hidden" id="pre_count" />';
      sss+='<input type="hidden" id="pre_version" />';
      sss+='<input type="hidden" id="mod_id" />';
      sss+='<input type="hidden" id="receive_id" />';
      sss+='<input type="hidden" id="category_id" />';
      sss+='<input type="hidden" id="pre_codes" />';
      sss+='<input type="hidden" id="pre_count_record" />';
      sss+='<tr><th  colspan="2"  align="center">更新库存版次</th></tr>';
      sss+='<tr><td style="width:100px;text-align:right;"><strong>型号：</strong></td><td style="text-align:left;">';
      sss+='<span id="mod_id_notice">'+msg.mod+'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FF0000">版次更新状态下，型号，资料种类不可以更改</font></td></tr>';
      sss+='<tr><td style="width:100px;text-align:right;"><strong>资料种类：</strong></td><td style="text-align:left;"><span id="category_id_notice">'+msg.category+'</span></td></tr>';
      sss+='<tr><td style="width:100px;text-align:right;"><strong>资料当前版本：</strong></td><td style="text-align:left;"><span id="current_id_notice">'+msg.current_version+'</span></td></tr>';
      sss+='<tr><td style="width:100px;text-align:right;"><strong>更新至版本：</strong></td><td style="text-align:left;"><select name="version_id" id="version_id" onchange="check_version(this)">'+msg.version+'</select><span id="version_id_notice">&nbsp;&nbsp;<font color="#FF0000">更新至版次必须高于当前版次</font></span></td></tr>';
	  sss+='<tr class="bg"><td style="width:100px;text-align:right;"><strong>更新单据号：</strong></td><td style="text-align:left;"><input type="text" class="text" name="codes" id="codes" value="" /></td></tr>';
	  sss+='<tr class="bg"><td style="width:100px;text-align:right;"><strong>更新份数：</strong></td><td style="text-align:left;"><input type="text" class="text" name="count" onKeyUp=this.value=this.value.match(/^[0-9]*[1-9][0-9]*$/)==null?"":this.value.match(/^[0-9]*[1-9][0-9]*$/) onafterpaste=this.value=this.value.match(/^[0-9]*[1-9][0-9]*$/)==null?"":this.value.match(/^[0-9]*[1-9][0-9]*$/) id="count" value="'+msg.count+'" /><span id="count_notice"></span></td></tr>';
	  sss+='<tr><td colspan="2"><input type="button" value="提交" class="button" id="submit" onclick="update_receive_data()"/><input type="button" value="返回" class="button" onclick="return_receive('+msg.category_id+')"/></td></tr></table>';    
	  $("#version_detail").html('');	   
	  $("#version_detail").html(sss);
	  
	   $("#mod_id_notice").html(msg.mod);
  	   $("#category_id_notice").html(msg.category);
  	   $("#version_id").html(msg.version);
  	   $("#count").val(msg.count);
  	   $("#pre_codes").val(msg.codes);
  	   $("#mod_id").val(msg.mod_id);
  	   $("#receive_id").val(msg.receive_id);
  	   $("#category_id").val(msg.category_id);
  	   $("#pre_count").val(msg.count);
       $("#pre_count_record").val(msg.count);
  	   $("#pre_version").val(msg.pre_verison);
    	   }
    	});
}  



function get_vesion_count(version){
	var mod_id = $("#mod_id").val();
	var category_id = $("#category_id").val();
	var version_id = $(version).val();
    $.ajax({
  	   type: "POST",
  	   url:"<?php echo  base_url();?>model/get_version_detail",
  	   data: "version_id="+version_id+"&mod_id="+mod_id+"&category_id="+category_id,
  	   success: function(msg){
      	 //库存量  
 	    	   $("#pre_count").val(msg);
 	    	   $("#count_notice").html("<font color='red'>此版本库存量仅剩"+msg+"本</font>");
  	   }
  	});
	
}




  function return_receive(category_id){
	  var role = $("#role").val();
	  $.ajax({
	   	   type: "POST",
	   	   url:"<?php echo  base_url();?>main/get_category_detail",
	   	   data: "category_id="+category_id,
	          dataType:'json', 
	   	   success: function(msg){       
	       	  var str = '<script language="javascript" src="<?php echo base_url();?>js/jquery.js"><\/script><script language="javascript" src="<?php echo base_url();?>js/jquery.modal.js"><\/script><table class="listing form" cellpadding="0" cellspacing="0" style="width:950px;">';
	                 str+='<tr><th class="first" width="100">型号</th><th>资料名称</th><th>资料版次</th><th>总份数</th><th>密级</th><th>接收日期</th><th>初始版次</th><th>当前版次</th><th>有效版次</th><th>发往单位</th><th>发出时间</th><th>更改时间</th><th>更改标记</th><th class="last">附注</th><th></th></tr>';
	   	      for(var i=0;i<msg.length;i++){
		   	    	str+='<tr><td><input type="hidden" value="'+msg[i].id+'" /><input type="hidden" value="'+msg[i].company+'" />'+msg[i].mod+'</td><td>'+msg[i].category+'</td><td>'+msg[i].version+'</td><td>'+msg[i].total_count+'</td><td>'+msg[i].level+'</td><td>'+msg[i].receive_date+'</td><td>'+msg[i].orignal_version+'</td><td>'+msg[i].current_version+'</td><td>'+msg[i].valid_version+'</td><td>'+msg[i].company+'</td><td>'+msg[i].sendtime+'</td><td>'+msg[i].updatetime+'</td><td>'+msg[i].updatedes+'</td><td>'+msg[i].updatedes+'</td><td>';
	                if(msg[i].current_version==msg[i].valid_version){
	              	      str+='</td></tr>';
	                    }else{
	                    	if(role==0){
                        	    str+='<span class="update_version" onclick="update_version(this)">更新版次</span></td></tr>';
                              }else{
                            	  str+='</td></tr>';
                              }
	                    }
	           	  }
	     	          str+='</table>'; 
	       	 $("#version_detail").html('');
	     	 $("#version_detail").append(str);   
		     $(".simplemodal-close").css({"display":"block"});   	  
	   	   }
	   	});
   }
  function update_version(s){
	  var id = $(s).parents("tr").children("td:eq(0)").children("input:eq(0)").val();
	  var company = $(s).parents("tr").children("td:eq(0)").children("input:eq(1)").val();
	  if(company==""){
         receive_update(id);
	  }else{
         send_update(id);
      }
   }    
</script>
    <input type="hidden" value="0" id="cate" />
    <input type="hidden" value="<?php echo $user[0]->role;?>" id="role" />
		<div id="center-column">
          <div class="selected">
             <div style="float:left;font-size:18px;width:100px;">筛选条件：</div><ul><li class="search_mod color" id="search_mod">型号：<span id="mod_span"><?php if($select_mod_id!=""){ foreach($mod as $k=>$val){ if($val->mod_id==$select_mod_id){ echo $val->name;}} }else{?>全部<?php }?></span><img src='<?php echo base_url();?>img/hr.gif' class='mod'/></li>
                 <li class="color" id="search_name">资料名称：<span id="category_span"><?php if($select_category_id!=""){ foreach($cate as $k=>$val){ if($select_category_id==$val->category_id){ echo $val->name; } } }else{?>全部<?php }?></span><img src='<?php echo base_url();?>img/hr.gif' class='category'/></li>
                 <li class="color" id="search_company">发放单位：<span id="company_span"><?php if($select_company_id!=""){ foreach($company as $k=>$val){ if($select_company_id==$val->company_id){echo $val->name;}} }else{?>全部<?php }?></span><img src='<?php echo base_url();?>img/hr.gif' class='company'/></li>
                 <li class="color" id="search_version">当前版次：<span id="version_span"><?php if($select_version_id!=""){ foreach($version as $k=>$val){ if($select_version_id==$val->version_id){ echo $val->name;}} }else{?>全部<?php }?></span><img src='<?php echo base_url();?>img/hr.gif' class='version2'/></li>
                 <li class="color" id="search_level">密级：<span id="level_span"><?php if($select_level!=""){ echo $level_data[$select_level]; }else{?>全部<?php }?></span><img src='<?php echo base_url();?>img/hr.gif' class='level'/></li>
                 <li class="color" id="search_update">更新情况：<span id="update_span"><?php if($select_update!=""){ echo $update_data[$select_update]; }else{?>全部<?php }?></span><img src='<?php echo base_url();?>img/hr.gif' class='update'/></li>
                 <li class="color" style="width:80px;"><span id="clear_all">全部清空</span></li>
             </ul>
          </div>
		  <div class="select-bar">
		   <?php echo form_open('main/index',array('id'=>'index_form'));?> 
		     <input type="hidden"  id="mod" name="mod" value="<?php echo $select_mod_id;?>" />
		     <input type="hidden"  id="category" name="category" value="<?php echo $select_category_id;?>" />
		     <input type="hidden"  id="version" name="version" value="<?php echo $select_version_id;?>" />
		     <input type="hidden"  id="company" name="company" value="<?php echo $select_company_id;?>" />
		     <input type="hidden"  id="level" name="level" value="<?php echo $select_level;?>" />
		     <input type="hidden"  id="update" name="update" value="<?php echo $select_update;?>" />
		     
 		    <dl class="mod">
		        <dt>型代号：</dt>
		        <dd><a href="javascript:void(0)" alt="">全部</a>&nbsp;&nbsp;<?php foreach($mod as $k=>$val):?><a href="javascript:void(0)" alt="<?php echo $val->mod_id?>"><?php echo $val->name;?></a>&nbsp;&nbsp;<?php endforeach;?></dd>
		    </dl>
		    <dl class="or category" >
		        <dt>资料名称：</dt>
		        <dd><div id="cate_more" width="30px;">&nbsp;&nbsp;更多&nbsp;&nbsp;</div><div style="width:840px;" id="category_detail"><a href="javascript:void(0)" alt="">全部</a>&nbsp;&nbsp;&nbsp;&nbsp;<?php foreach($cate as $k=>$val):?><a href="javascript:void(0)" alt="<?php echo $val->category_id;?>"><?php echo $val->name;?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php endforeach;?></div></dd>
		    </dl>
		    <dl class="company">
		        <dt>发放单位：</dt>
		        <dd><a href="javascript:void(0)" alt="">全部</a>&nbsp;&nbsp;<?php foreach($company as $k=>$val):?><a href="javascript:void(0)" alt="<?php echo $val->company_id;?>"><?php echo $val->name;?></a>&nbsp;&nbsp;<?php endforeach;?></dd>
		    </dl>
		    <dl class="update">
		        <dt>更新情况：</dt>
		        <dd><a href="javascript:void(0)" alt="">全部</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="0">库存已更新</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="1">库存未更新</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="2">发放已更新</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="3">发放未更新</a></dd>
		    </dl>
		    <dl class="version">
		        <dt>当前版次：</dt>
		        <dd></dd>
		    </dl>
		    <dl class="level">
		        <dt>资料密级：</dt>
		        <dd><a href="javascript:void(0)" alt="">全部</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="0">机密</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="1">秘密</a>&nbsp;&nbsp;<a href="javascript:void(0)" alt="2">内部</a>&nbsp;&nbsp;</dd>
		    </dl>
		    <dl>
		        <dt>接收日期：</dt>
		        <dd><input name='first_time' id='first_time' class='date-pick' value="<?php echo $first_time;?>" ><span style="float:left;">
		            &nbsp;&nbsp;发出日期：</span><input name='second_time' id='second_time' class='date-pick' value="<?php echo $second_time;?>"  >
		            <span style="float:left;">&nbsp;&nbsp;更改日期：</span><input name='third_time' id='third_time' class='date-pick' value="<?php echo $third_time;?>"  >
		            &nbsp;&nbsp;<input type="submit" value="开始检索" /></dd>
		    </dl>
           </form>   
		  </div>
		  <div class="select-bar">
		     <dl><dt>资料合计</dt>
		         <dd><span style="float:left;"><?php echo $modcount;?>个型号&nbsp;&nbsp;<?php echo $categorycount;?>种用户技术资料&nbsp;&nbsp;<?php echo $totalcount;?>份技术资料</span>
		             <span style="float:right;color:#FF0000;font-size:14px;">未更新至最新版本 - &nbsp;&nbsp;<?php echo $invalid_category;?>种用户技术资料&nbsp;&nbsp;<?php echo $invalid_files;?>份技术资料 </span> 
		         </dd>
		     </dl>
		     <?php if($modcount==1){?>
		     <dl><dt>成套资料</dt>
		         <dd><?php echo $total_complete;?>个全套资料&nbsp;&nbsp;<?php   if($temp_com!=""){echo $temp_com;}?></dd>
		     </dl>
		     <?php }?>
		  </div>
			<div class="table">
				
				<table class="listing" cellpadding="0" cellspacing="0">
					<tr>
						<th class="first" width="100">型号</th>
						<th>资料编码</th>
						<th>资料名称</th>
						<th>密级</th>
						<th>有效版次</th>
						<th>总份数</th>
						<th>已更新</th>
						<th>未更新</th>
						<th>库存量</th>
						<th>发放单位</th>
						<th></th>						
					</tr>
					
					<?php foreach($category as $k=>$val):?>
					<tr <?php if($val->need_update==1){?>class="bs"<?php }?>>
						<td class="first style1"><?php foreach($mod as $i=>$j){ if($j->mod_id==$val->mod_id){echo $j->name;}}?></td>
						<td><?php echo $val->codes;?></td>
						<td style="text-align:left;padding-left:5px;"><?php echo $val->name;?></td>
						<td><?php echo $level_data[$val->level];?></td>						
						<td><?php echo $val->valid_version;?></td>
						<td><?php echo $val->total_count;?></td>
						<td><?php echo $val->valid_count;?></td>
						<td><?php echo $val->invalid_count;?></td>
						<td><?php echo $val->left_count;?></td>						
						<td class="last"><?php if($val->company==""){echo "此资料没有发放记录！";}else{echo $val->company;}?></td>
						<td class="trs" id="<?php echo $val->category_id;?>">查看明细</td>
					</tr>
				<?php endforeach;?>	
					
				</table>
				<div><?php echo $page;?>
			  </div>
			</div>
		</div>
	</div>
	
<!-- 接收更新弹层 -->	
 <div id="receive_detail">

 </div>
	<div id="footer"></div>
</div>
<div id="version_detail">
   
</div>

</body>
</html>
